<%
Dim strOrder
select case Ssort
	case "caid": 
		if Ssort="caid" and SN="y" then
			strOrder="caid desc"
			SN="n"
		else
			strOrder="caid"
			SN="y"
		end if
	case "ComplectNumber": 
		if Ssort="ComplectNumber" and SN="y" then
			strOrder="ComplectNumber desc"
			SN="n"
		else
			strOrder="ComplectNumber"
			SN="y"
		end if
	case "NameCompl": 
		if Ssort="NameCompl" and SN="y" then
			strOrder="NameCompl desc"
			SN="n"
		else
			strOrder="NameCompl"
			SN="y"
		end if
	case "DateTimeL": 
		if Ssort="DateTimeL" and SN="y" then
			strOrder="DateTimeL desc"
			SN="n"
		else
			strOrder="DateTimeL"
			SN="y"
		end if
	case "AutomatNumber": 
		if Ssort="AutomatNumber" and SN="y" then
			strOrder="CAAutomat desc"
			SN="n"
		else
			strOrder="CAAutomat"
			SN="y"
		end if
	case "Place": 
		if Ssort="Place" and SN="y" then
			strOrder="Place desc"
			SN="n"
		else
			strOrder="Place"
			SN="y"
		end if
	case "NamePerson": 
		if Ssort="NamePerson" and SN="y" then
			strOrder="NamePerson desc"
			SN="n"
		else
			strOrder="NamePerson"
			SN="y"
		end if
	case "DateSet": 
		if Ssort="DateSet" and SN="y" then
			strOrder="DateSet desc"
			SN="n"
		else
			strOrder="DateSet"
			SN="y"
		end if
	case "DateLoad": 
		if Ssort="DateLoad" and SN="y" then
			strOrder="DateLoad desc"
			SN="n"
		else
			strOrder="DateLoad"
			SN="y"
		end if
	case else: strOrder="caid desc"
end select
%>